package cn.jiayen.comm.util;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by jiayen on 2018/5/8.
 */
public class CustomerStringUtils {

    /**
     * 把字符串转换为集合(根据id移除实体时使用)
     * @return
     */
    public static List<Integer> strToList(String ids){
        List<Integer> list = new ArrayList<>();
        if(ids.contains(",")){
            String[] idList = ids.split(",");
            for (int i = 0; i < idList.length; i++) {
                list.add(Integer.valueOf(idList[i]));
            }
        }else{
            list.add(Integer.valueOf(ids));
        }
        return list;
    }
}
